﻿@model IEnumerable<TravelWeb.Models.Supplier>
@{
    ViewBag.Title = "Supplier";
}
<h2>
    Supplier</h2>
<p>
    @if (User.IsInRole("Manager"))
    {
        @Html.ActionLink("Create New", "Create");
    }
</p>
<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Type
        </th>
        <th>
            Address
        </th>
        <th>
            Phone
        </th>
        <th>
            Status
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.SupplierName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.SupplierType)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Address)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Phone)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Status)
            </td>
            <td>
                @if (User.IsInRole("Manager"))
                {
                    @Html.ActionLink("Edit | ", "Edit", new { id = item.SupplierID });
                    @Html.ActionLink("Details | ", "Details", new { id = item.SupplierID });
                    @Html.ActionLink("Delete | ", "Delete", new { id = item.SupplierID });
                }
            </td>
        </tr>
    }
</table>
